package Niuke;

import java.util.Scanner;
//将用户输入的六个数字填入数组并找出数组中最大值和最小值
public class Main {
    public static void main(String[] args) {
        int[] ary = new int[6];
        int max;
        int min;
        Scanner scanner = new Scanner(System.in);
     	for (int i = 0; i <ary.length ; i++) {
            ary[i]=scanner.nextInt();
        }

        //write your code here......
        for (int j = 0; j < ary.length-1; j++) {
            for (int x = 0; x < ary.length-j-1; x++) {
                if(ary[x]>ary[x+1]){
                    int t=0;
                    t=ary[x];
                    ary[x]=ary[x+1];
                    ary[x+1]=t;
                }
            }
        }
        max=ary[5];
        min=ary[0];
        System.out.println(max+" "+min);
    }
}